package com.tcoiss.log.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tcoiss.common.core.annotation.Excel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 接口调用日志对象 call_api_log
 * 
 * @author zw
 * @date 2021-05-07
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("api_log")
public class ApiLog implements Serializable {

private static final long serialVersionUID=1L;


    /** 编号 */
    @TableId(type = IdType.AUTO)
    private Long id;

    /** 接口名称 */
    @Excel(name = "接口名称")
    private String apiName;

    /** api编码 */
    @Excel(name = "api编码")
    private String apiCode;

    /** 请求参数 */
    @Excel(name = "请求参数")
    private String requestParam;

    private String requestType;

    /** 响应数据 */
    @Excel(name = "响应数据")
    private String responseData;

    /** 接口状态 */
    @Excel(name = "接口状态")
    private Integer status;

    /** 异常信息 */
    @Excel(name = "异常信息")
    private String errorMsg;

    /** 调用时间 */
    @Excel(name = "调用时间" , width = 30, dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date callTime;

    /** 调用人 */
    @Excel(name = "调用人")
    private String callUser;

    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();
}
